import java.util.Random;

public class NumberGenerator {
    private int number;
    /**
    *是否需要收到惩罚
    */
    private boolean flag;

    public NumberGenerator() {

    }

    public int getNumber() {
        return number;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public NumberGenerator(int number, boolean flag) {
        this.number = number;
        this.flag = flag;
    }

    /**
     * 随机生成一个数字 在 min 和max之间
     */
    public int generateRandom(int min, int max) {
        // 生成最大值和最小值的random
        Random random = new Random();
        return random.nextInt(max - min + 1) + min;
        //return (int) (Math.random() * (max - min + 1) + min);
    }
}
